<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创建虚拟 DOM 对象 - JSX</title>
</head>
<body>
    <div id="root"></div>

    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>
    <script src="../js/babel.min.js"></script>

    <script type="text/babel">
        //虚拟 DOM 对象.  本质就是一种特殊的对象.  最终会生成真实 DOM 对象, 插入到文档中.
        //单层结构
        // let vDOM = <h2>一剑！一念！</h2>; // JSX
        //多层结构
        let vDOM = <div>
                <h2 title="上海疫情" id="bt">上海疫情有点吓人</h2>
                <p>今日,上海总感染人数超过 2w, 全国都在支援上海!!!</p>
            </div>; // JSX 

        //比较真实 DOM 与虚拟 DOM
        // console.dir(vDOM);
        // console.dir(document.querySelector("#root"));

        //渲染
        ReactDOM.render(vDOM, document.querySelector("#root"));

    </script>
</body>
</html>